package com.shd.edanpei.bean;

import com.shd.edanpei.R;
import com.shd.edanpei.db.DaoManager;
import com.shd.edanpei.enums.RoleEnum;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by mc on 2018/10/31.
 * yang-wen-wen
 */

public class MenuModel {


    /**
     * 首页菜单数据
     *
     * @return
     */
    public static List<MenuData> getHomeMenuList() {
        List<MenuData> list = new ArrayList<>();
        int roleType = DaoManager.getInstance().getUserBean().getRoleType();
        if (roleType == RoleEnum.bank.getId()) {
            list.add(new MenuData(1, "银行入口", R.drawable.home_ic_support,0));
        } else {
            list.add(new MenuData(2, "代理入口", R.drawable.home_ic_apply,0));
        }
        list.add(new MenuData(3, "E资讯", R.drawable.home_ic_news,0));
        list.add(new MenuData(4, "帮助中心", R.drawable.home_ic_help,0));
        list.add(new MenuData(5, "操作指南", R.drawable.home_ic_order,0));
        return list;
    }

    /**
     * 我的界面菜单
     * "银行经理角色"没有<我的团队>
     */
    public static List<MenuData> getMineMenuList(int notReadMessage) {
        int roleType = DaoManager.getInstance().getUserBean().getRoleType();
        List<MenuData> list = new ArrayList<>();
        list.add(new MenuData(1, "我的账户", R.drawable.yhk,0));
        list.add(new MenuData(2, "意见反馈", R.drawable.yjfk,0));
        list.add(new MenuData(3, "通讯录", R.drawable.txl,0));
        list.add(new MenuData(4, "消息", R.drawable.xx,notReadMessage));
        list.add(new MenuData(5, "一键分享", R.drawable.fx,0));
        list.add(new MenuData(6, "联系客服", R.drawable.kf,0));

        //list.add(new MenuData(, "设置", R.drawable.myb));
        if (roleType == RoleEnum.boss.getId()
                || roleType == RoleEnum.other.getId()) {
            list.add(new MenuData(7, "我的团队", R.drawable.tuandui_icon,0));
        }
        list.add(new MenuData(8, "商城", R.drawable.icon_huiyuan,0));
        list.add(new MenuData(9, "我的邀请", R.drawable.icon_yaoqing,0));
        return list;
    }

    public static class MenuData {

        private int id;
        private String menuName;
        private int menuIcon;
        private int notReadMessage;

        public MenuData(int id, String menuName, int menuIcon,int notReadMessage) {
            this.id = id;
            this.menuName = menuName;
            this.menuIcon = menuIcon;
            this.notReadMessage=notReadMessage;
        }

        public int getId() {
            return id;
        }

        public String getMenuName() {
            return menuName;
        }

        public int getMenuIcon() {
            return menuIcon;
        }
        public int getNotReadMessage() {
            return notReadMessage;
        }
    }
}
